# parent greenlet
import greenlet


def test1(x, y):
    print(id(greenlet.getcurrent()), id(greenlet.getcurrent().parent), end="\n")
    z = gr2.switch(x + y)
    print('back z:' + z)


def test2(u):
    print(id(greenlet.getcurrent()), id(greenlet.getcurrent().parent), end="\n")
    return 'hehe'


gr1 = greenlet.greenlet(test1)
gr2 = greenlet.greenlet(test2)

print(id(greenlet.getcurrent()), id(gr1), id(gr2), end="\n")
print(gr1.switch("hello", "world"), 'back to main',end="\n")
